package com.education.welco.mapper;


import com.education.welco.pojo.SAnsweringComment;
import com.education.welco.pojo.SCommentResq;
import com.education.welco.pojo.vo.MessageList;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (答疑讨论) 数据层
 *
 * @author d
 * @date 2022-06-20
 */
@Repository
public interface SAnsweringCommentMapper {

    /**
     * 查询
     *
     * @param id      动态id
     * @param type    排序类型 1 最新 2 热门
     * @param plLevel 评论层级1，2
     * @return 评论列表
     */
    public List<SCommentResq> selectSysUserForumsCommentListOther(@Param("id") String id,
                                                                  @Param("type") String type,
                                                                  @Param("plLevel") String plLevel);

    /**
     * 查询二级评论列表集合
     *
     * @param list    id 集合
     * @param plLevel 评论层级1，2
     * @return
     */
    public List<SCommentResq> selectSecondLevelForumsCommentList(@Param("list") List<String> list, @Param("type") String type, @Param("plLevel") String plLevel);

    /**
     * 查询(答疑讨论)信息
     *
     * @param cPlId (答疑讨论)ID
     * @return (答疑讨论)信息
     */
    public SAnsweringComment selectSAnsweringCommentById(Integer cPlId);

    /**
     * 查询(答疑讨论)列表
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return (答疑讨论)集合
     */
    public List<SAnsweringComment> selectSAnsweringCommentList(SAnsweringComment sAnsweringComment);

    /**
     * 新增(答疑讨论)
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return 结果
     */
    public int insertSAnsweringComment(SAnsweringComment sAnsweringComment);

    /**
     * 修改(答疑讨论)
     *
     * @param sAnsweringComment (答疑讨论)信息
     * @return 结果
     */
    public int updateSAnsweringComment(SAnsweringComment sAnsweringComment);

    /**
     * 删除(答疑讨论)
     *
     * @param cPlId (答疑讨论)ID
     * @return 结果
     */
    public int deleteSAnsweringCommentById(Integer cPlId);

    /**
     * 批量删除(答疑讨论)
     *
     * @param cPlIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteSAnsweringCommentByIds(String[] cPlIds);

    int updateSysUserforumsComment(SAnsweringComment sysUserforumsComment);

    public int stickSAnsweringComment(@Param("cPostId") Integer cPostId, @Param("cPlId") Integer cPlId);

    /**
     * 新增(用户论坛评论)
     *
     * @param sAnsweringComment
     * @return
     */
    int insertSysUserforumsComment(SAnsweringComment sAnsweringComment);

    List<MessageList> selectCommentListBySAnswerId(@Param("list") List<Integer> twoIntList);

    SAnsweringComment selectCommentListByResId(@Param("resId") Integer resId);

    //搜索每个答疑的讨论人数量
    List<Integer> countEachAnswerTalkPeopleNum(Integer id);

    Integer countEachAnswerTalkNum(Integer id);

    Integer stickSAnsweringCommentForTeacher(@Param("cPlId") Integer cPlId, @Param("stick") Integer stick);
}